package com.uzai.common.enums;

/**
 * 账户明细类型
 * @author liuqi
 * @date 2021/8/27 17:19
 * @param
 * @return null
 */
public enum MdExchangeStatusEnum {
    SUCCESS(0,"兑换成功"),
    NOT_START(1,"当前活动未开始，不能领取"),
    REG_TIME_EXPIRE(2,"您的注册时间为：【%s】；不满足注册时间【%s】小时内，领取【%s】次的条件"),
    REG_TIME_EXCHANGE_OUT(3,"您的注册时间为：【%s】；领取次数为：【%s】次；不满足注册时间【%s】小时内，领取【%s】次的条件"),
    GOODS_COUNT_DEFICIENCY(4,"该商品已被领完"),
    USER_EXHANGE_GOODS_COUNT_DEFICIENCY(5,"该商品您已领取【%s】次，领取次数已用完"),
    USER_INTEGRAL_DEFICIENCY(6,"积分不足，领取商品所需积分：【%s】,您当前积分：【%s】"),
    CONFIG_PLAN_REG_TIME_EXPIRE(7,"您的注册时间：【%s】，不满足活动要求的注册时间：【%s】-【%s】"),
    CONFIG_PLAN_USER_TYPE_GROUP_ELIMINATE(8,"您的会员类型组不属于活动设置的会员类型组"),
    CONFIG_PLAN_USER_TYPE_ELIMINATE(9,"您的会员类型不属于活动设置的会员类型"),
    CONFIG_PLAN_INVITATION_ELIMINATE(10,"您当前%s邀请的人数为：【%s】,不满足活动要求：【%s】人"),
    CONFIG_PLAN_DEVICE_ELIMINATE(11,"您所在（设备/群）不属于活动设置的范围内"),
    INVITE_COUNT_DEFICIENCY(12,"该活动需邀请人数为：【%s】人，您当前邀请人数为：【%s】人。不满足该兑换条件！"),
    TAG_ERR(13,"不满足活动兑换所需条件"),
    ;
    private Integer value;
    private String desc;

    MdExchangeStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static MdExchangeStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (MdExchangeStatusEnum type: MdExchangeStatusEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
